import { createSlice } from '@reduxjs/toolkit'
// PayloadAction<State>
export type State = {
  count: number
}
const initialState: State = {
  count: 1
}
const countSlice = createSlice({
  name: 'count',
  initialState,
  reducers: {
    countAdd: (state: State, { payload }) => {
      state.count += payload
    }
  }
})
export const { countAdd } = countSlice.actions
export default countSlice.reducer
